package com.biao.transaction.example.common.enums;

/**
 * @description: 响应代码
 * @author:chenwenbiao
 * @createTime:2019/5/30 8:40
 * @version：1.0
 **/
public enum ResponseCode {

    /**
     * 通用
     */
    PARAMETER_INVALID(10001, "参数错误！"),
    SERVER_UNKNOWN_EXCEPTION(10002, "服务器未知错误！"),
    ADD_FAIL(10010, "添加失败！"),
    UPDATE_FAIL(10011, "更新失败！"),
    DELETE_FAIL(10012, "删除失败！"),

    /**
     * 图片上传
     */
    IMAGE_UPLOAD_FAIL(40001, "图片上传失败！"),
    IMAGE_UPLOAD_SUCCESS(40002, "图片上传成功！"),

    /**
     * 用户相关
     */
    USER_LOGIN_FAIL(50001, "登录失败，账号或密码不正确！"),
    USER_LOGIN_FAIL_DISABLE(50002, "登录失败，用户被禁用！"),
    USER_LOGIN_FAIL_EXPIRE_TIME(50003, "登录失败，服务已到期！"),
    USER_PASSWORD_NOT_MATCH(50004, "原密码不正确！"),
    USER_CHANGE_PASSWORD_FAIL(50005, "更新密码失败！"),
    USER_PHONE_VERIFICATION_CODE_EXPIRED(50006, "验证码过期！"),
    USER_PHONE_IS_ALREADY_BOUND(50007, "手机号已绑定过"),
    USER_BIND_PHONE_VERIFICATION_CODE_ERROR(50008, "验证码不正确！"),
    USER_PHONE_BIND_FAIL(50009, "绑定手机号失败！"),
    USER_PHONE_NOT_SEND(50010, "手机号尚未绑定！"),
    USER_PHONE_SEND_MESSAGE_FAIL(50011, "发送验证码失败！"),
    USER_INFO_UPDATE_FAIL(50012, "更新用户信息失败！"),
    USER_SAVE_BATCH_FAIL(50013, "批量增加用户失败！"),
    USER_SAVE_DUPLICATE_USER_NAME(50014, "操作失败，数据库中存在重名账号！"),
    USER_OPERATE_RECORD_SAVE_FAIL(50015, "操作行为记录添加失败！"),

    /**
     * 手机验证码
     */
    SEND_MESSAGE_FAILED(60001, "发送短信失败！"),
    SEND_MESSAGE_TOO_FAST(60002, "发送短信过于频繁！"),
    SEND_MESSAGE_VERIFICATION_ERROR(60003, "短信验证码不正确！"),

    /**
     * 学校
     */
    SCHOOL_INFO_SAVE_FAIL(70001, "保留学校信息失败！"),
    SCHOOL_INFO_DELETE_FAIL(70002, "删除学校信息失败！"),


    /**
     * 同步数据给学科网
     */
    XKW_SYNCHRONIZATION_TASK_SAVE_FAIL(80001, "同步给学科网的任务添加失败！"),

    ;
    final private Integer code;
    final private String msg;

    ResponseCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
